<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title></title>
		<script src="js/echarts.js"></script>

	</head>
	<body>
		<!-- 
		   1.引入echarts.js
		   2.为echarts准备一个定义了宽高的DOM
		   3.基于准备好的dom,初始化echarts实例
		   4.指定图表 的配置项和数据
		   5.给echarts实例设置配置项
	    -->
		<div id="main" style="width: 100%;height: 500px;"></div>
		<script type="text/javascript">
			var chartDom = document.getElementById('main');
			var myChart = echarts.init(chartDom);
			var option;

			option = {
				title: {
					text: '实时访客',
				},
				legend: {
					type: 'scroll'
				},
				grid: {
					show: false
				},
				tooltip: {
					trigger: 'axis'
				},
				xAxis: {
					type: 'category',
					data: ['星期一', '星期二', '星期三', '星期四', '星期五', '星期六', '星期日']
				},
				yAxis: {
					type: 'value'
				},
				series: [{
					name: '浏览量',
					data: [160, 230, 224, 218, 135, 147, 260],
					type: 'line',
				}, {
					name: '访客数',
					data: [180, 200, 214, 208, 235, 247, 290],
					type: 'line',
				}]
			};

			option && myChart.setOption(option);
		</script>
	</body>
</html>
